import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrEntryApplyVO, HrEntryApplyForm, HrEntryApplyQuery } from '@/api/general/humanresources/onboard/entry/types';

/**
 * 查询新员工入职材料审批列表
 * @param query
 * @returns {*}
 */

export const listHrEntryApply = (query?: HrEntryApplyQuery): AxiosPromise<HrEntryApplyVO[]> => {
  return request({
    url: '/humanresource/hrEntryApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询新员工入职材料审批详细
 * @param id
 */
export const getHrEntryApply = (id: string | number): AxiosPromise<HrEntryApplyVO> => {
  return request({
    url: '/humanresource/hrEntryApply/' + id,
    method: 'get'
  });
};

/**
 * 新增新员工入职材料审批
 * @param data
 */
export const addHrEntryApply = (data: HrEntryApplyForm) => {
  return request({
    url: '/humanresource/hrEntryApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改新员工入职材料审批
 * @param data
 */
export const updateHrEntryApply = (data: HrEntryApplyForm) => {
  return request({
    url: '/humanresource/hrEntryApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除新员工入职材料审批
 * @param id
 */
export const delHrEntryApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrEntryApply/' + id,
    method: 'delete'
  });
};
